import request from '@/utils/request'
function getUrl(url) { return '/api/' + url }
export function getVersions() {
  return request({
    url: getUrl('/system/apk/versions'),
    method: 'get'
  })
}

export function getPagingVersions(data) {
  return request({
    url: getUrl('/system/apk/versionPageQuery'),
    method: 'post',
    data
  })
}

export function addVersionInfo(data) {
  return request({
    url: getUrl('/system/apk/newVersion'),
    method: 'post',
    data
  })
}

export function uploadApkFile(formData) {
  return request({
    url: getUrl('/system/apk/uploadApk'),
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function deleteVersion(data) {
  return request({
    url: getUrl('/system/apk/delete'),
    method: 'post',
    data
  })
}

export function updateVersion(data) {
  return request({
    url: getUrl('/system/apk/updateInfo'),
    method: 'post',
    data
  })
}


export function getDataById(data) {
  return request({
    url: getUrl('/system/apk/getDataById'),
    method: 'post',
    data
  })
}


export function deleteData(data) {
  return request({
    url: getUrl('/system/apk/deleteData'),
    method: 'post',
    data
  })
}
